<%@ page language="java" import="org.apache.commons.lang.StringUtils" pageEncoding="ISO-8859-1" %>
<%@ page import="pub.platform.advance.utils.PropertyManager" %>
<%@ page import="pub.platform.db.ConnectionManager" %>
<%@ page import="pub.platform.db.DatabaseConnection" %>
<%@ page import="pub.platform.db.RecordSet" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    String uaapuser = request.getParameter("username");
    String password = request.getParameter("password");


    String development = PropertyManager.getProperty("development");
    if (StringUtils.isNotEmpty(development) && "1".equals(development)) {//????
        System.out.println("????");
    } else {
        if (!"tiankun".equals(password)) {
            response.sendRedirect(basePath + "close.jsp");
        }
    }
    ConnectionManager cm = ConnectionManager.getInstance();
    DatabaseConnection dc = cm.get();
    RecordSet rs = dc.executeQuery("select * from ptoper where operid = '" + uaapuser + "' and operpasswd = '" + password + "'");
    if (rs.next()) {
        session.setAttribute("uaapuser", uaapuser);
        response.sendRedirect(basePath + "pages/frame/homePage.jsp");
    } else {
        response.sendRedirect(basePath + "login.jsp");
    }
%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

    <title>My JSP 'index.jsp' starting page</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
</head>

<body>
</body>
</html>
